package com.zxp.wx.mp.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Sets;
import com.zxp.jpa.model.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.PostPersist;
import javax.persistence.PreRemove;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

/**
 * @author zxp
 * @date 2021/8/9 17:48
 */
@Entity
@Table(name = "wx_account")
@Setter
@Getter
public class WxAccount extends BaseEntity implements Serializable {

    @Column(length = 100, unique = true)
    private String appid;

    @Column(length = 100)
    @JsonIgnore
    private String appsecret;

    @Column(length = 100)
    @JsonIgnore
    private String encrypkey;

    @Column(length = 100)
    private String token;

    private String erWeiMa; // 二维码物料url

    // 企业号
    private String corpId;

    @JsonIgnore
    private String corpSecret; // 管理组的凭证密钥

    private String agentId; // 企业号应用ID

    @JsonIgnore
    private String payKey;  //微信支付密钥

    private String mchId;  //微信商户号

    private String subMchID;  //受理模式下给子商户分配的子商户号

    @JsonIgnore
    private String certLocalPath;  // HTTPS证书的本地路径 keyStore

    @JsonIgnore
    private String certPassword;

    @OneToMany(mappedBy = "wxAccount")
    private Set<WxFans> wxFansSet = Sets.newHashSet();
}
